<?php
/*
# ------------------------------------------------------------------------
# JA Job Board Package
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/
jimport( 'joomla.application.component.view' );


class JAJobBoardViewJAMail extends JAView
{
    /**
     * Display the view
     */
    function display($tmpl = null)
    {
		$task = JRequest::getVar("task", '');
		switch ($task){
			case 'preview':				
				JAJobBoardViewJAMail::displayEmail();
				break;			
			default:
				JAJobBoardViewJAMail::displayForm();
		}
		parent::display($tmpl);
  	}
  	
  	
  	/**
  	* Display List of items
  	*/
  	function displayForm(){  
  		global $option;		
  		
		$emails = $this->get('Email');		
		$editor = &JFactory::getEditor();		
		$jbconfig = JRequest::getVar('config', null);
		
		$tags_to_assign = array();
		$variable = JobBoardConstant::get_Variable_Email();
				
		$tags_to_assign[] = JHTML::_('select.option',  '', JText::_('** Please choose an option below and it will be inserted into email message **'));
		$tags_to_assign = array_merge($tags_to_assign,$variable);
		
		$tags_to_assign   = JHTML::_('select.genericlist', $tags_to_assign, 'tags', 'class="small" style="background-color: buttonface; width:100%; color: black;" onclick="insertVariable(this)" size="5"','value', 'text');	
	    $this->assignRef('tags', $tags_to_assign);
		

        $this->assignRef('emails', $emails);
        $this->assignRef('config', $jbconfig);
        $this->assignRef('editor', $editor);
        $this->assignRef('option', $option);

  	}
  	

  
  	
  	/**
  	* Display edit form
  	*/
  	function displayEmail(){  	

  		global $mainframe;
  		$this->setLayout('preview');		

	}
}
?>